<?php
use yii\helpers\Html;
?>
<?php $this->beginPage() ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <?= Html::csrfMetaTags() ?>
    <title>打印小票</title>
    <?php $this->head() ?>
    <style>
        *{padding: 0;margin: 0}
        .cj-xp{background:#FFF;text-align:center;padding:16px;}
        .cj-xp p{text-align:left;padding-top:5px;}
        .cj-xp ul{text-align:left;}
        .cj-xp ul li{line-height:20px;}
        .cj-xp ul li span{float:right}
    </style>
    <OBJECT  ID="jatoolsPrinter" CLASSID="CLSID:B43D3361-D075-4BE2-87FE-057188254255"  codebase="jatoolsPrinter.cab#version=8,6,0,0"></OBJECT>
</head>
<?php $this->beginBody() ?>

<body>
<div id="page1" class="page">
    <?=$data?>
</div>
</body>

<?php $this->endBody() ?>
<script>
    function ticketPrint(){
        var myDoc = {
            settings: {
                topMargin: 0,
                leftMargin: 0,
                bottomMargin: 0,
                rightMargin: 0,
                paperWidth:800,
                paperHeight:"auto"
            },
            marginIgnored:true,
            //documents: window.top.$('iframe[name=iframe-print]')[0].contentWindow.document,
            documents: document,
            copyrights: '杰创软件拥有版权  www.jatools.com'
        };
        var jatoolsPrinter = document.getElementById("jatoolsPrinter");
        //jatoolsPrinter.printPreview(myDoc,false);
        jatoolsPrinter.print(myDoc,false);
    }
</script>

</html>
<?php $this->endPage() ?>